const BaseUrl = 'http://localhost:8080/api'
// const BaseUrl = 'http://192.168.18.113:8080'
export const request = (options) => {
	return new Promise((resolve, reject) => {
		uni.request({
			url: BaseUrl + options.url,
			method: options.method,
			data: options.data,
			success: (res) => {
				if (res.data.code !== "200") {
					return uni.showToast({
						title: '接口请求失败',
						icon: "none"
					})
				}
				resolve(res.data)
			},
			fail: (res) => {
				console.log(res.data);
				reject(res)
			}
		})
	})
}
